package com.xiangge.test;

public class Demo2 {
    public static void main(String[] args) {
        int count = 0;
        for (int i = 101; i <= 200; i++) {
            if (sushu(i)) {
                count++;
                System.out.print(i+" ");
            }
        }
        System.out.println();
        System.out.println("一共有" + count + "个质数");
    }

    public static boolean sushu(int i) {
        for (int j = 2; j <= i - 1; j++) {
            if (i %j==0){
                return false;
            }
        }
        return true;
    }
}
